<?php
class Application_Model_service_DanhMucBanTinService implements Application_Model_serviceInf_DanhMucBanTinServiceInf {
	protected static $_instance = null;
	
	protected function __construct() {
	
	}
	public static function getInstance() {
		if (self::$_instance == null) {
			self::$_instance = new self ();
		}
		return self::$_instance;
	}
	
	public function taoDanhMuc($tenDanhMuc, $chuThich) {
		$kq = 0;
		
		$save = Application_Model_dataDAO_DanhMucBanTinDAO::getInstance ();
		$kq = $save->insert ( $tenDanhMuc, $chuThich );
		
		return $kq;
	}
	
	/**
	 * @param unknown_type $maDanhMuc
	 */
	
	public function suaDanhMuc($maDanhMuc, $tenDanhMuc, $chuThich) {
		$kq = false;
		
		$dao = Application_Model_dataDAO_DanhMucBanTinDAO::getInstance ();
		$kq = $dao->update ( $maDanhMuc, $tenDanhMuc, $chuThich );
		
		return $kq;
	}
	
	/**
	 * @param unknown_type $maDanhMuc
	 */
	public function xoaDanhMuc($maDanhMuc) {
		$kq = false;
		
		$dao = Application_Model_dataDAO_DanhMucBanTinDAO::getInstance();
		$kq = $dao->delete($maDanhMuc);
		
		return $kq;
	}
	
	/**
	 * 
	 */
	public function getAllDanhMucBanTin() {
		$kq = array();
		
		$dao = Application_Model_dataDAO_DanhMucBanTinDAO::getInstance();
		$kq = $dao->loadAll();
		
		return $kq;
	}
	
	/**
	 * @param unknown_type $maDanhMuc
	 */
	public function getMotDanhMucBanTin($maDanhMuc) {
		$kq = array();
		
		$dao = Application_Model_dataDAO_DanhMucBanTinDAO::getInstance();
		$kq = $dao->load($maDanhMuc);
		
		return $kq;
	}
/**
 * @param unknown_type $maDanhMuc
 * @param unknown_type $tenDanhMuc
 * @param unknown_type $chuThich
 */

}
?>
